﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO;
using DTO;

namespace BUS
{

    public class KHACHHANGBUS
    {
        KHACHHANGDAO khDAO= new KHACHHANGDAO();
        KHACHHANGDTO khDTO= new KHACHHANGDTO();
        public DataTable GET_KHACHHANG()
        {
            KHACHHANGDAO DAO = new KHACHHANGDAO();
            DataTable dt = new DataTable();
            dt = DAO.GET_KHACHHANG();
            return dt;
        }
        public void THEM_KHACHHANG(string tenkh, string sdtkh, int diemtichluy)
        {
            khDTO.TenKH = tenkh;
            khDTO.SDTKH = sdtkh;
            khDTO.DiemTichKuy = diemtichluy;
            khDAO.THEM_KHACHHANG(khDTO);
        }
        public void CAPNHAT_KHACHHANG( string tenkh, string sdtkh, int diemtichluy)
        {
            //khDTO.MaKH = makh;
            khDTO.TenKH = tenkh;
            khDTO.SDTKH = sdtkh;
            khDTO.DiemTichKuy = diemtichluy;
            khDAO.CAPNHAT_KHACHHANG(khDTO);
        }
        public void XoaDoAn(int makh)
        {
            khDTO.MaKH = makh;
            khDAO.XOA_KHACHHANG(khDTO);
        }
    }
}
